/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     struct TreeNode *left;
 *     struct TreeNode *right;
 * };
 */
bool sameval(struct TreeNode* root, struct TreeNode* root1)
{
    if (root == NULL && root1 == NULL)
    {
        return true;
    }
    if (root && root1 && (root->val == root1->val))
    {
        return sameval(root->left, root1->right) && sameval(root->right, root1->left);
    }
    return false;
}
bool isSymmetric(struct TreeNode* root) {
    if (root == NULL)
    {
        return true;
    }
    return sameval(root->left, root->right);
}